<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../Css/addRefund.css">
    <link rel="stylesheet" href="../Css/btn.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/c/font_3911564_ynvs5zhem7p.css">
</head>

<body>
    <div class="rightmain1">
        <div>
            <div>回款详情</div>
            <div>
                <button type="submit" class="btn1 " onclick="xiugaicontract1()" id="baocunbtn"><span
                        class="iconfont icon-export"></span>保存</button>
                <button class="btn1"><a href="../refund/reManage.html"><span class="iconfont icon-export"></span>返回</a>
                </button>
            </div>
        </div>
    </div>
    <div class="jibenxingxi">
        <div><span class="iconfont icon-liebiao spanhk"></span>回款信息</div>
        <form action="">
            <ul>
                <li><span class="ispanWidth">回款日期：</span><input value="" id="payment_day1">
                </li>
                <li><span class="ispanWidth">客户名称：</span><input type="text" value="" id="Client_name1">
                </li>
                <li><span class="ispanWidth">合同编号：</span><input type="text" value="" id="contract_number1"></li>
                <li><span class="ispanWidth">回款金额（万元）：</span><input type="text" value="" id="payment_amount1"></li>
                <li><span class="ispanWidth">回款期次：</span><input type="text" value="" id="payment_period1"></li>
                <li><span class="ispanWidth">付款方式：</span><input type="text" value="" id="payment_method1"></li>
                <li><span class="ispanWidth">银行：</span><input type="text" value="" id="bank1"></li>
                <li><span class="ispanWidth">账号：</span><input type="text" value="" id="account1"></li>
                <li><span class="ispanWidth">是否逾期：</span><input type="text" value="" id="isOverdue1">
                </li>
                <li><span class="ispanWidth">逾期天数：</span><input type="text" value="" id="Overdue1"></li>
                <li><span class="ispanWidth">备注：</span><input type="text" value="" id="note1"></li>
            </ul>
        </form>
    </div>


    <script>







        xiugaicontract();
        xiugaicontract1();
        displaytableDatakh();
        hqidr();



        //初始化数据
        function xiugaicontract() {
            console.log(1);
            let index;
            contract.forEach(e => {
                if (e.id == idtzm) {
                    index = e.id;
                }
            });
            // $('#name1').val('值');
            $("#payment_day1").val(contract[index - 1].payment_day);
            $("#Client_name1").val(contract[index - 1].Client_name);
            $("#contract_number1").val(contract[index - 1].contract_number);
            $("#payment_amount1").val(contract[index - 1].payment_amount);
            $("#payment_period1").val(contract[index - 1].payment_period);
            $("#contract_amount1").val(contract[index - 1].contract_amount);
            $("#payment_period1").val(contract[index - 1].payment_period);
            $("#bank1").val(contract[index - 1].bank);
            $("#payment_method1").val(contract[index - 1].payment_method);
            $("#account1").val(contract[index - 1].account);
            $("#isOverdue1").val(contract[index - 1].isOverdue);
            $("#Overdue1").val(contract[index - 1].Overdue);
            $("#note1").val(contract[index - 1].note);
        }



        //xiugai合同
        function xiugaicontract1() {
            console.log(1);
            let index;
            contract.forEach(e => {
                if (e.id == idtzm) {
                    index = e.id;
                }
            });

            db.contract[index - 1].payment_day = $("#payment_day1").val();
            // db.contract[index - 1].Client_name = cmval;
            db.contract[index - 1].Client_name = $("#Client_name1").val();
            db.contract[index - 1].contract_number = $("#contract_number1").val();
            db.contract[index - 1].payment_amount = $("#payment_amount1").val();
            db.contract[index - 1].payment_period = $("#payment_period1").val();
            db.contract[index - 1].contract_amount = $("#contract_amount1").val();
            db.contract[index - 1].payment_period = $("#payment_period1").val();
            db.contract[index - 1].payment_method = $("#payment_method1").val();
            db.contract[index - 1].account = $("#account1").val();
            db.contract[index - 1].isOverdue = $("#isOverdue1").val();
            db.contract[index - 1].Overdue = $("#Overdue1").val();
            db.contract[index - 1].note = $("#note1").val();

            // asyncLocalStory("contract");
            asyncLocalStory();


        }





    </script>




</body>

</html>